#define _CRT_SECURE_NO_WARNINGS	


char cstr[10000010];
char* replaceSpaces(char* S, int length)
{
    int num = 0;
    for (int i = 0; i < length; i++)
    {
        if (S[i] != ' ')
            cstr[num] = S[i];
        else
        {
            cstr[num] = '%';
            num++;
            cstr[num] = '2';
            num++;
            cstr[num] = '0';
        }
        num++;
    }
    cstr[num] = '\0';
    return cstr;
}